<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视频上传和参数输入</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            width: 300px;
            text-align: center;
        }
        h1 {
            color: #333;
            margin-bottom: 20px;
        }
        input[type="file"], select, input[type="number"] {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .button-row {
            display: flex;
            justify-content: space-between; /* 添加间距 */
            width: 100%;
            margin-top: 20px;
        }

        button {
            background-color: #868e96;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            width: 100%;
        }
        button:hover {
            background-color: #1e1e1e;
        }
        video {
            width: 100%;
            border-radius: 5px;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>视频上传和参数输入</h1>
        <input type="file" id="videoFile" accept="video/*">
        <h2>视频预览</h2>
        <video id="videoPreview" controls></video>
        <select id="positionSelect">
            <option value="single">单人视频</option>
            <option value="group">多人视频</option>
        </select>
        <div>
            <label for="heightInput">输入身高（cm）:</label>
            <input type="number" id="heightInput" value="170">
    
        </div>
        <div class="button-row">
            <button style="margin: 8px;" onclick="goToCompetition()">比赛分析</button>
            <button style="margin: 8px;" onclick="generateAbalysis()">动作分析</button>
        </div>
    </div>
    <script>
        document.getElementById('videoFile').addEventListener('change', function(e) {
            const file = e.target.files[0];
            if (file) {
                const videoURL = URL.createObjectURL(file);
                document.getElementById('videoPreview').src = videoURL;
            }
        });

        // function uploadVideo() {
        //     const height = document.getElementById('heightInput').value;
        //     // Here you would typically send the video and parameters to a server
        //     // For this example, we'll just navigate to the competition page
        //     window.location.href = 'competition.html';
        // }
        function goToCompetition() { window.location.href = 'competition.html'; }
        function generateAbalysis() { window.location.href = 'analysis.html'; }
    </script>
    </script>
</body>
</html>